﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Admin.master" AutoEventWireup="true" CodeFile="Suggest.aspx.cs" Inherits="SY.WebSite.Web.View.Suggest" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>建议管理 - 后台管理系统 - <%= Settings.Title %></title>
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/pagination.css" rel="stylesheet" type="text/css" />    
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/JqModal/JqPopU.css" rel="stylesheet" type="text/css" />
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/skin/default/main.css" rel="stylesheet" type="text/css" />
    <%--<script src="<%= Settings.StaticFileDomain %>/Scripts/util/My97DatePicker/WdatePicker.js" type="text/javascript"></script>--%>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/template/trimpath-template.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/jquery.pagination.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/jquery.ui.uapselector.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/JqModal/JqPopU.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/utility.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" Runat="Server">
    <div>
	    <h1>
		    <small>建议管理</small>
	    </h1>
    </div>
    <form class="form-search">
        <fieldset>
            状态：
            <select id="status" style="width:80px">
                <option value="100">全部</option>
                <option value="0">未跟进</option>
                <option value="1">处理中</option>
                <option value="2">待审核</option>
                <option value="3">已完成</option>
            </select>
            提交人所属部门：<input class="input-medium" id="deptName" type="text" placeholder="提交人所属部门"/> 
            涉及部门：<input class="input" id="relateDeptName" type="text" placeholder="涉及部门"/>             
            <button type="button" class="btn" onclick="page.getList(0)">查询</button>
        </fieldset>
    </form>
    <div id="result"></div>
    <div id="pagination"></div>
    <textarea name="suggest" id="suggest" style="display:none;"> 
    <table class="table table-hover table-striped">
		<thead>
			<tr>
				<th>状态</th><th>建议</th><th>奖励</th><th>涉及部门</th><th>管理员/批示信息</th><th>处理人/反馈内容</th>
                <th>&nbsp;</th>
            </tr>
        </thead>
		<tbody>
            {for p in list}
			<tr>
                <td>{if p.Status == 0}未处理{elseif p.Status == 1}处理中{elseif p.Status == 2}待审核{else}已完成{/if}</td>
				<td>
                    <%--<dl class="dl-horizontal">
                        <dt>时间</dt>
                        <dd>@{p.CreateTime.ToDate().Format("yyyy-MM-dd hh:mm")}</dd>
                        <dt>提交人</dt>
                        <dd>@{p.UserName}<small>(@{p.UserId})</small></dd>
                        <dt>所属部门</dt>
                        <dd>@{p.DeptName}</dd>
                        <dt>主题</dt>
                        <dd>@{p.Title}</dd>
                        <dt>内容</dt>
                        <dd>@{p.Description.replace(/\n/g,'<br />')}</dd>
                    </dl>
--%>
                    <blockquote>
                        <p>@{p.Title}</p>
                        <small>@{p.UserName}(@{p.UserId}) @{p.DeptName} <cite title="Source Title">@{p.CreateTime.ToDate().Format("yyyy-MM-dd hh:mm")}</cite></small>
                        <p style="font-weight:normal; font-size:14px;">@{p.Description.replace(/\n/g,'<br />')}</p>
                    </blockquote>
                </td>
                <td>{if p.Amount>0} @{p.Amount} {if p.Type ==1}素币{elseif}元{/if}{/if}</td>
                <td>@{p.RelateDeptName}</td>
                <td>
                    {if p.ControlUserId>0}
                    <%--<dl class="dl-horizontal">
                        <dt>管理员</dt>
                        <dd>@{p.ControlUserName}<small>(@{p.ControlUserId})</small></dd>
                        {if p.ControlComment !=""}
                        <dt>批示信息</dt>
                        <dd>@{p.ControlComment}</dd>
                        {/if}
                    </dl>--%>
                        <blockquote>
                            <p style="font-weight:normal; font-size:14px;">{if p.ControlComment}@{p.ControlComment.replace(/\n/g,'<br />')}{/if}</p>
                            <small>@{p.ControlUserName} (@{p.ControlUserId})</small>
                        </blockquote>
                    {/if}
                </td>
                <td>
                    {if p.ToUserId>0}
                    <blockquote>
                        <p style="font-weight:normal; font-size:14px;">{if p.Feedback && p.Feedback != ""}@{p.Feedback.replace(/\n/g,'<br />')}{else}<span class="muted">暂未反馈</span>{/if}</p>
                        <small>@{p.ToUserName} (@{p.ToUserId})</small>
                    </blockquote>
                    {/if}
                </td>
                <td>
                    {if p.Status != 3}
                    <div class="btn-group">
                        <a class="btn" href="#">操作</a>
                        <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
                        <ul class="dropdown-menu">
                        {if p.Status !=3 && p.Type ==0}
                        <li><a href="javascript:void(0)" onclick="page.grant(@{p.Id})">奖励</a></li>
                        {/if}
                        {if p.Status == 0}
                        <li><a href="javascript:void(0)" onclick="page.forward(@{p.Id})">转他人处理</a></li>
                        {elseif p.Status == 1}
                        <li><a href="javascript:void(0)" onclick="page.forward(@{p.Id})">转他人处理</a></li>
                        {elseif p.Status == 2}
                        <li><a href="javascript:void(0)" onclick="page.forward(@{p.Id},'打回重新处理')">拒绝通过，重新处理</a></li>
                        {/if}              
                        <li class="divider"></li>
                        <li><a href="javascript:void(0)" onclick="page.closeSuggest(@{p.Id})">设为完成</a></li>
                        </ul>
                    </div>
                    {/if}
                </td>
			</tr>
            {forelse}
            <tr><td colspan="9">暂无相关数据</td></tr>
            {/for}
		</tbody>
	</table>
    </textarea>

    <textarea name="detail" id="detail" style="display:none;"> 
        <div class="row">
            <div class="span4">
                <form class="form-horizontal">
                    <div class="control-group">
                        <label class="control-label">员工</label>
                        <div class="controls">
                            <label class="control-label" style="width:240px; text-align:left;">@{UserName}<small>(@{JobNumber})</small></label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="udeptName">所属部门</label>
                        <div class="controls">
                            <input id="udeptName" placeholder="所属部门" type="text" value="@{DeptName}" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="uphone">手机</label>
                        <div class="controls">
                            <input id="uphone" placeholder="手机" type="text" value="@{Phone}" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls">
                            <button type="button" class="btn btn-info" id="btnEdit">修改</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="span5">
                <form class="form-horizontal">
                    <div class="control-group">
                        <label class="control-label" for="ugender">性别</label>
                        <div class="controls">
                            <select id="ugender">
                                <option value="0">请选择</option>
                                <option value="1">男</option>
                                <option value="2">女</option>
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="ujobName">职位</label>
                        <div class="controls">
                            <input id="ujobName" placeholder="职位" type="text" value="@{JobName}" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="uemail">邮箱</label>
                        <div class="controls">
                            <input id="uemail" placeholder="邮箱" type="text" value="@{Email}" />
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </textarea>

    <script src="<%= Settings.StaticFileDomain %>/Scripts/page/admin/suggest.js" type="text/javascript"></script>
    <script type="text/javascript">
        page.userList =<%= ToJson(UserList) %>;
    </script>
</asp:Content>